#ifndef MTIMER_H
#define MTIMER_H

#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <sys/time.h>
#include "augmavconn/message_fifo.h"
#include "augmavconn/msgcombine.h"

#include <ros/ros.h>




#define mT_MaxFifo 256

class Message_FIFO_WR_T;
struct FunC
{
    Message_FIFO_WR_T* test;
    void(Message_FIFO_WR_T:: *f)();
};
class mTimer
{
public:

   void AddHander(Message_FIFO_WR_T * test,void(Message_FIFO_WR_T:: * f)());
   void start(int interval);

   void TimeOut();
   static mTimer* getInstance();

   void ch_priority(uint8_t *priority);

   void add_mTmessage(Message_FIFO_WR_T* m);
   void statistics_printf();

private:
     mTimer();
    static mTimer* Timer;
    FunC _handler[256];
    Message_FIFO_WR_T* mT_message[256];
    int mT_p;
    int _p;
};

#endif // MTIMER_H
